<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<link rel='stylesheet' type="text/css" href="/Public/admin/css/style.css" />
<script type="text/javascript" src="/Public/admin/js/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="/Public/admin/js/common.js"></script>
<script type="text/javascript" src="/Public/admin/js/jquery.form.min.js"></script>
<script type="text/javascript" src="<?php echo U(MODULE_NAME. '/Public/editor');?>"></script>

<script type="text/javascript">
	var data_path = "/Data";
	var tpl_public = "/Public/admin";
</script>
<script type="text/javascript" src="/Public/admin/js/jBox.config.js"></script>
<script type="text/javascript">
$(function () {
	//缩略图上传
	var litpic_tip = $(".litpic_tip");
	var btn = $(".litpic_btn span");
	$("#fileupload").wrap("<form id='myupload' action='<?php echo U(MODULE_NAME. '/Public/upload', array('tb' => 2));?>' method='post' enctype='multipart/form-data'></form>");
    $("#fileupload").change(function(){
    	if($("#fileupload").val() == "") return;
		$("#myupload").ajaxSubmit({
			dataType:  'json',
			beforeSend: function() {
        		$('#litpic_show').empty();
				btn.html("上传中...");
    		},
			success: function(data) {
				//litpic_tip.html("<b>"+data.title+"("+data.size+"k)</b> <span class='delimg' rel='"+data.url+"'>删除</span>");
				if(data.state == 'SUCCESS'){					
					litpic_tip.html(""+ data.title +" 上传成功("+data.size+"k)");
					var img = data.url;//原图
					var timg = data.turl;//缩略图
					$('#litpic_show').html("<img src='"+timg+"' width='120'>");
					$("#litpic").val(timg);
				}else {
					litpic_tip.html(data.state);		
				}			
					btn.html("添加图片");

			},
			error:function(xhr){
				btn.html("上传失败");
				litpic_tip.html(xhr);
			}
		});
	});

	$('#CK_JumpUrl').click(function(){
            var inputs = $(this).parents('dl').find('input');
            if($(this).attr('checked')) {
                $('#JumpUrlDiv').show();

            }else {
                $('#JumpUrlDiv').hide();
            }
            
     });
	
});




$(function () {

	$('#BrowerPicture').click(function(){
		$.jBox("iframe:<?php echo U(MODULE_NAME.'/Public/browseFile', array('stype' => 'picture'));?>",{
			title:'XYHCMS',
			width: 650,
   			height: 350,
    		buttons: { '关闭': true }
   			}
		);
	});	

});


function selectPicture(sfile) {
	$("#litpic").val(sfile);
	$.jBox.tip("选择文件成功");
	$.jBox.close(true);
	$('#litpic_show').html("<img src='"+sfile+"' width='120'>");
}


</script>

</head>
<body>
<div class="main">
    <div class="pos">专家管理</div>
	<div class="form">
		<form method='post' id="form_do" name="form_do" action="<?php echo U(MODULE_NAME. '/Zhuanjia/add');?>">
        <dl><dt>专家名称：</dt>
			<dd>
                <input type='text' name='name' class="inp_large"/>
			</dd>
		</dl>

		<dl>
			<dt> 缩略图：</dt>
			<dd>
				<div class="litpic_show">
				    <div style="float:left;">
				    <input type="text" class="inp_w250" name="litpic" id="litpic"  value="<?php echo ($tRow['litpic']); ?>" />
				    <input type="button" class="btn_blue_b" id="BrowerPicture" value="选择站内图片">
				    </div>
						<div class="litpic_btn">
				        <span>添加缩略图</span>
				        <input id="fileupload" type="file" name="mypic">
				    </div>
				    <div class="litpic_tip"></div>
				    <div id="litpic_show">
				    <?php if($tRow['litpic']): ?><img src="<?php echo ($tRow['litpic']); ?>" width='120' /><?php endif; ?>
				    </div>
				</div>
			</dd>
		</dl>
		<dl><dt>摘要：</dt>
			<dd>
				<textarea name="description" class="tarea_default"></textarea>
			</dd>
		</dl>

        <dl><dt>科室：</dt>
			<dd>
                <input type='text' name='department' class="inp_large"/>
			</dd>
		</dl>
        <dl><dt>职业：</dt>
			<dd>
                <input type='text' name='occupation' class="inp_large"/>
			</dd>
		</dl>

		<dl><dt>专家介绍：</dt><dd>
				<textarea name="introduction" id="content"></textarea>
			</dd>
		</dl>
		<dl>
			
		</dl>	
		</div>
		<div class="form_b">
			<input type="submit" class="btn_blue" id="submit" value="提 交">
		</div>
	   </form>
	</div>


</body>
</html>